Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PaymentParameters creation utility and support BOLT12 #129

Merged
merged 4 commits into from
Feb 13, 2024

Conversation

TheBlueMatt
Copy link
Contributor

No description provided.

Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

src/main.rs Outdated Show resolved Hide resolved
src/cli.rs Outdated Show resolved Hide resolved
@TheBlueMatt
Copy link
Contributor Author

$ git diff-tree -U2 b8fc019 afccd1e
diff --git a/src/cli.rs b/src/cli.rs
index 7e79ac9..32a713d 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -184,5 +184,5 @@ pub(crate) fn poll_for_user_input(
 								(_, Some(amt)) => amt,
 								(amt, _) => {
-									println!("ERROR: Cannot process non-Bitcoin-amount'd offer value {:?}", amt);
+									println!("ERROR: Cannot process non-Bitcoin-denominated offer value {:?}", amt);
 									continue;
 								}
diff --git a/src/main.rs b/src/main.rs
index 1de7109..6b4dbdd 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -520,6 +520,6 @@ async fn handle_ldk_events(
 						for addr in sockaddrs {
 							let pm = Arc::clone(&peer_manager);
-							if cli::do_connect_peer(node_id, addr, pm).await.is_ok() {
-								break;
+							if cli::connect_peer_if_necessary(node_id, addr, pm).await.is_ok() {
+								return;
 							}
 						}

@tnull
Copy link
Contributor

tnull commented Feb 12, 2024

CI needs one more cargo fmt here.

@TheBlueMatt
Copy link
Contributor Author

Ugh, thanks.

$ git diff-tree -U1 afccd1e a9273ad
diff --git a/src/cli.rs b/src/cli.rs
index 32a713d..a70d772 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -180,11 +180,10 @@ pub(crate) fn poll_for_user_input(

-						let amt_msat =
-							match (offer.amount(), user_provided_amt) {
-								(Some(offer::Amount::Bitcoin { amount_msats }), _) => *amount_msats,
-								(_, Some(amt)) => amt,
-								(amt, _) => {
-									println!("ERROR: Cannot process non-Bitcoin-denominated offer value {:?}", amt);
-									continue;
-								}
-							};
+						let amt_msat = match (offer.amount(), user_provided_amt) {
+							(Some(offer::Amount::Bitcoin { amount_msats }), _) => *amount_msats,
+							(_, Some(amt)) => amt,
+							(amt, _) => {
+								println!("ERROR: Cannot process non-Bitcoin-denominated offer value {:?}", amt);
+								continue;
+							}
+						};
 						if user_provided_amt.is_some() && user_provided_amt != Some(amt_msat) {
$ 

@tnull tnull merged commit 78659f3 into lightningdevkit:main Feb 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants